home *** CD-ROM | disk | FTP | other *** search
-
-
-
- shmget C Library Procedures shmget
-
-
-
- NNAAMMEE
- shmget - get shared memory segment
-
- SSYYNNTTAAXX
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//iippcc..hh>>
- ##iinncclluuddee <<ssyyss//sshhmm..hh>>
-
- iinntt sshhmmggeett ((kkeeyy,, ssiizzee,, sshhmmffllgg))
- kkeeyy__tt kkeeyy;;
- iinntt ssiizzee,, sshhmmffllgg;;
-
- DDEESSCCRRIIPPTTIIOONN
- The system call returns the shared memory identifier associ-
- ated with _k_e_y.
-
- A shared memory identifier and associated data structure and
- shared memory segment of size _s_i_z_e bytes are created for _k_e_y
- if one of the following are true:
-
- The _k_e_y is equal to IPC_PRIVATE. For further infor-
- mation, see intro(2).
-
- The _k_e_y does not already have a shared memory iden-
- tifier associated with it, and (_s_h_m_f_l_g & IPC_CREAT )
- is "true".
-
- Upon creation, the data structure associated with the new
- shared memory identifier is initialized as follows:
-
- The sshhmm__ppeerrmm..ccuuiidd,,shm_perm.uid,sshhmm__ppeerrmm..ccggiidd,, and
- sshhmm__ppeerrmm..ggiidd are set equal to the effective user ID
- and effective group ID, respectively, of the calling
- process.
-
- The low-order 9 bits of sshhmm__ppeerrmm..mmooddee are set equal
- to the low-order 9 bits of _s_h_m_f_l_g. The sshhmm__sseeggsszz is
- set equal to the value of _s_i_z_e.
-
- The sshhmm__llppiidd,,shm_nattch,sshhmm__aattiimmee,, and sshhmm__ddttiimmee are
- set equal to 0. The sshhmm__ccttiimmee is set equal to the
- current time.
-
- RREETTUURRNN VVAALLUUEE
- Upon successful completion, a non-negative integer, namely a
- shared memory identifier is returned. Otherwise, a value of
- -1 is returned and _e_r_r_n_o is set to indicated the error.
-
- DDIIAAGGNNOOSSTTIICCSS
- The system call will fail if one or more of the following
- are true:
-
-
-
-
- Sprite v1.0 1
-
-
-
-
-
-
- shmget C Library Procedures shmget
-
-
-
- [EINVAL] The _s_i_z_e is less than the system imposed
- minimum or greater than the system imposed
- maximum.
-
- [EACCES] A shared memory identifier exists for _k_e_y but
- operations permission as specified by the
- low-order 9 bits of _s_h_m_f_l_g would not be
- granted. For further information, see
-
- [EINVAL] A shared memory identifier exists for _k_e_y but
- the size of the segment associated with it is
- less than _s_i_z_e and _s_i_z_e is not equal to zero.
-
- [ENOENT] A shared memory identifier does not exist for
- _k_e_y and (_s_h_m_f_l_g & IPC_CREAT ) is "false".
-
- [ENOSPC] A shared memory identifier is to be created
- but the system imposed limit on the maximum
- number of allowed shared memory identifiers
- system wide would be exceeded.
-
- [ENOMEM] A shared memory identifier and associate
- shared memory segment are to be created by
- the amount of available physical memory is
- not sufficient to fill the request.
-
- [EEXIST] A shared memory identifier exists for _k_e_y but
- ((_s_h_m_f_l_g & IPC_CREAT ) & (_s_h_m_f_l_g & IPC_EXCL
- )) is "true".
-
- SSEEEE AALLSSOO
- shmctl(2), shmop(2), ftok(3)
-
- BBUUGGSS
- The System V shared memory functions are implemented at user
- level on top of the mmap(2) interface. Not all the System V
- functionality is implemented.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sprite v1.0 2
-
-
-
-